/*! Sdm Main V2 - v0.1.0 - * Copyright (c) 2022 Trapeze; */!function(a){"$:nomunge";function b(b){function d(){b?g.removeData(b):m&&delete c[m]}function f(){i.id=setTimeout(function(){i.fn()},n)}var g,h=this,i={},j=b?a.fn:a,k=arguments,l=4,m=k[1],n=k[2],o=k[3];if("string"!=typeof m&&(l--,m=b=0,n=k[1],o=k[2]),b?(g=h.eq(0),g.data(b,i=g.data(b)||{})):m&&(i=c[m]||(c[m]={})),i.id&&clearTimeout(i.id),delete i.id,o)i.fn=function(a){"string"==typeof o&&(o=j[o]),!0!==o.apply(h,e.call(k,l))||a?d():f()},f();else{if(i.fn)return void 0===n?d():i.fn(!1===n),!0;d()}}var c={},d="doTimeout",e=Array.prototype.slice;a[d]=function(){return b.apply(window,[0].concat(e.call(arguments)))},a.fn[d]=function(){var a=e.call(arguments),c=b.apply(this,[d+a[0]].concat(a));return"number"==typeof a[0]||"number"==typeof a[1]?this:c}}(jQuery),function(a){var b=a.jQuery;((a.NR||(a.NR={})).resolve("SDM.HeaderFooter.Widgets").BrooklynLogin=function(a,c){c=c||{};var d={data_attributes:{is_logged_in:"wg-hbl-logged-in"},selectors:{container:"[data-wg-hbl-container]"}};this.$widget=a,this.config=b.extend(!0,{},d,c),this._init()}).prototype._init=function(){}}(this),function(){var a=this,b=a._,c=a.jQuery,d=a.NR||(a.NR={}),e=d.resolve("SDM.HeaderFooter.Widgets"),f=d.resolve("SDM.Core.Components"),g=f.EventHub,h="sdm-headerbar",i=function(a,b,c){this.config=c,this.$item=a,this.toolbar=b,this.name=this.$item.data(this.config.data_attributes.tool),this.$dropdown=this.$item.find(this.config.selectors.dropdown),this._initialize()};i.prototype._initialize=function(){this.$dropdown.length>0&&this._bindEvents()},i.prototype._bindEvents=function(){var a=b(this._handleClick).bind(this);this.$item.on("click."+h,a);var c=b(this._stopEvent).bind(this);this.$dropdown.on("click."+h,c)},i.prototype._stopEvent=function(a){a.stopPropagation()},i.prototype._handleClick=function(a){a.preventDefault(),this._isActive()?this._deactivateCurrent():this._activate()},i.prototype._activate=function(){g.fire(g.EVENTS.HEADER_TOOL_CLICKED,this.name,this.$item),this._deactivatePrevious(),this.$item.toggleClass(this.config.classes.active),this.$item.find(this.config.selectors.button).attr("aria-expanded","true"),this._bindBodyClick()},i.prototype._deactivatePrevious=function(){this.toolbar._getCurrentActiveItem().removeClass(this.config.classes.active),this.toolbar._getCurrentActiveItem().find(this.config.selectors.button).attr("aria-expanded","false")},i.prototype._deactivateCurrent=function(){this.$item.removeClass(this.config.classes.active),this.$item.find(this.config.selectors.button).attr("aria-expanded","false"),this._unbindBodyClick()},i.prototype._isActive=function(){return this.$item.hasClass(this.config.classes.active)},i.prototype._bindBodyClick=function(){c("body").on("click."+h+this.name,b.bind(function(a){0===this.$item.find(a.target).length&&this._deactivateCurrent()},this))},i.prototype._unbindBodyClick=function(){c("body").off("click."+h+this.name)};var j=e.HeaderBar=function(a){var b={namespace:"sdm-header",selectors:{tools:"[data-wg-hb-tool]",dropdown:"[data-wg-hb-tool-dropdown]",button:"[data-wg-hb-tool-button]",load_to_win_button:"[data-wg-hb-l2w-button]",refills_tool_text:"[data-wg-hb-refills-tool-text]",skip_to_main:"[data-wg-hb-skip-to-main]",skip_to_footer:"[data-wg-hb-skip-to-footer]",sdm_header:"div.widget-header",sdm_footer:"section.footer",focusable_elements:"a[href]:not([disabled]), area[href]:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, [contenteditable]"},data_attributes:{is_rx_user_refills_tool_text:"wg-hb-is-rx-user-refills-tool-text",is_not_rx_user_refills_tool_text:"wg-hb-is-not-rx-user-refills-tool-text",tool:"wg-hb-tool"},classes:{active:"wg-hb-tool-active"}};this.config=b,this.$widget=a,this._initialize(),this._initializeEvents()};j.prototype._initialize=function(){var a=this.$widget.find(this.config.selectors.tools),b=this;a.each(function(){new i(c(this),b,b.config)}),this.has_updated_load_to_win_href=!1,this.is_rx_user_refills_tool_text=this.$widget.data(this.config.data_attributes.is_rx_user_refills_tool_text)||"",this.is_not_rx_user_refills_tool_text=this.$widget.data(this.config.data_attributes.is_not_rx_user_refills_tool_text)||""},j.prototype._initializeEvents=function(){g.subscribe("COUPON_LOADED",this._updateLoadToWinOffersLoadedHref,this);var a=this.$widget.find(this.config.selectors.skip_to_main),b=this.$widget.find(this.config.selectors.skip_to_footer),d=this;a.on("keydown",function(a){if(13===a.keyCode){event.preventDefault();var b=c(d.config.selectors.sdm_header).closest("header").nextAll(":not(:hidden)").first();b.attr("id")||b.attr("id",Math.random().toString().substr(2,5)),document.location.href="#"+b.attr("id")}}),b.on("keydown",function(a){if(13===a.keyCode){a.preventDefault();c(d.config.selectors.sdm_footer).find(d.config.selectors.focusable_elements).filter(":not(:hidden)")[0].focus()}})},j.prototype._getCurrentActiveItem=function(){return this.$widget.find(this.config.selectors.tools+"."+this.config.classes.active)},j.prototype._updateLoadToWinOffersLoadedHref=function(){if(!this.has_updated_load_to_win_href){var a=this.$widget.find(this.config.selectors.load_to_win_button),b=a.attr("href");a.attr("href",Util.prepareLoadToWinOffersLoadedUrl(b)),this.has_updated_load_to_win_href=!0}},j.prototype.setIsRxUser=function(a){if(!b.isBoolean(a))throw new Error("`is_rx_user` must be a Boolean.");this.$widget.find(this.config.selectors.refills_tool_text).text(a?this.is_rx_user_refills_tool_text:this.is_not_rx_user_refills_tool_text)}}.call(this),function(){var a=this,b=a._,c=a.NR||(a.NR={}),d=c.resolve("SDM"),e=c.resolve("SDM.HeaderFooter.Widgets"),f=d.Util,g=e.HeaderMobileBanner=function(a){this.$widget=a,this.config={cookie:{days_until_expire:365,key:"sdm-is-mobile-banner-viewed"},selectors:{button_close:"[data-hdrmb-close]"}},this._initialize()};g.prototype._initialize=function(){var b=$(a);this._bindCloseButtonClick(),this._bindWindowBecomeToWide(b),this._bindWindowResizeWhenNarrow(b),f.isWindowNarrow()&&this._updateBodyHeight()},g.prototype._bindCloseButtonClick=function(){var a=this.config.selectors.button_close;this.$widget.on("click",a,b.bind(this._onCloseButtonClick,this))},g.prototype._bindWindowBecomeToWide=function(a){a.on("becometowide",b.bind(this._onWindowBecomeToWide,this))},g.prototype._bindWindowResizeWhenNarrow=function(a){a.on("resizewhennarrow",b.bind(this._onWindowResizeWhenNarrow,this))},g.prototype._onCloseButtonClick=function(a){a.preventDefault(),this._hideBanner(),this._setViewedCookie()},g.prototype._onWindowBecomeToWide=function(){this._updateBodyHeight()},g.prototype._onWindowResizeWhenNarrow=function(){this._updateBodyHeight()},g.prototype._daysToMilliseconds=function(a){return 24*a*60*60*1e3},g.prototype._hideBanner=function(){this.$widget.hide(),this._updateBodyHeight()},g.prototype._setViewedCookie=function(){var a=this.config.cookie.key,b=this.config.cookie.days_until_expire||365,c=this._daysToMilliseconds(b),d=new Date((new Date).getTime()+c);f.saveCookie(a,"true",null,d.toString())},g.prototype._updateBodyHeight=function(){$("body").css({"padding-top":f.isWindowNarrow()?f.getMobileHeaderBarHeight()+"px":""})}}.call(this),function(){var a=this,b=a.jQuery,c=a.NR||(a.NR={}),d=c.resolve("SDM.HeaderFooter.Widgets"),e="sdm-header-scroller",f=d.HeaderScroller=function(a,c){var d={header_bar_namespace:"sdm-header-scroller-hb",mobile_header_bar_namespace:"sdm-header-scroller-hb-mobile",campaign_header_namespace:"sdm-header-scroller-ch",selectors:{header_bar:"[data-wg-hds-header-bar]",mobile_header_bar:"[data-wg-hds-mobile-header-bar]",campaign_header:"[data-wg-hds-campaign-header]"},classes:{header_bar_drop_shadow:"wg-hds-header-bar-drop-shadow",campaign_header_fixed:"wg-hds-campaign-header-fixed"}};this.config=b.extend(!0,d,c||{}),this._initialize()};f.prototype._initialize=function(){this._setInstanceVars(),b(window).on("becometowide."+e,_(function(){this._switchModeToDesktop()}).bind(this)),b(window).on("becometonarrow."+e,_(function(){this._switchModeToMobile()}).bind(this)),SDM.Util.isWindowWide()?this._initializeDesktopScroller():this._initializeMobileScroller()},f.prototype._setInstanceVars=function(){this.headerFixed=!1,this.$window=b(window),this.$body=b("body"),this.$campaignHeader=b(this.config.selectors.campaign_header)},f.prototype._initializeDesktopScroller=function(){var a=null;this.$headerBar=b(this.config.selectors.header_bar),this.$campaignHeader.length>0?(a=this._campaignHeaderScrollWatch.bind(this),this.campaignHeaderTop=this.$campaignHeader.offset().top-this._getHeaderBarHeight(),this.campaignHeaderAttached=!1,this.$window.on("scroll."+this.config.campaign_header_namespace,a),a()):(a=this._scrollWatch.bind(this),this.$window.on("scroll."+this.config.header_bar_namespace,a),a())},f.prototype._initializeMobileScroller=function(){this.$headerBar=b(this.config.selectors.mobile_header_bar);var a=this._scrollWatch.bind(this);this.$window.on("scroll."+this.config.mobile_header_bar_namespace,a),a()},f.prototype._switchModeToDesktop=function(){this.$headerBar.removeClass(this.config.classes.header_bar_drop_shadow),this.$window.off("scroll."+this.config.mobile_header_bar_namespace),this._initializeDesktopScroller()},f.prototype._switchModeToMobile=function(){this.$window.off("scroll."+this.config.header_bar_namespace),this.$window.off("scroll."+this.config.campaign_header_namespace),this.$headerBar.removeClass(this.config.classes.header_bar_drop_shadow),this.$campaignHeader.removeClass(this.config.classes.campaign_header_fixed),this._initializeMobileScroller()},f.prototype._scrollWatch=function(){var a=SDM.Util.getScrollPos();a>0&&!this.headerFixed?(this.$headerBar.addClass(this.config.classes.header_bar_drop_shadow),this.headerFixed=!0):0===a&&this.headerFixed&&(this.$headerBar.removeClass(this.config.classes.header_bar_drop_shadow),this.headerFixed=!1)},f.prototype._campaignHeaderScrollWatch=function(){var a=SDM.Util.getScrollPos();0===a&&this.headerFixed&&(this.$headerBar.removeClass(this.fixed_class),this._fixPagePadding(this._getHeaderBarHeight()),this.headerFixed=!1,this.campaignHeaderAttached&&(this.$campaignHeader.removeClass(this.config.classes.campaign_header_fixed),this.campaignHeaderAttached=!1)),a>0&&!this.headerFixed&&(this.$headerBar.addClass(this.config.classes.header_bar_drop_shadow),this._fixPagePadding(this._getHeaderBarHeight()),this.headerFixed=!0),a>=this.campaignHeaderTop&&!this.campaignHeaderAttached&&(this.$campaignHeader.addClass(this.config.classes.campaign_header_fixed),this.$headerBar.removeClass(this.config.classes.header_bar_drop_shadow),this._fixPagePadding(this._getHeaderBarHeight()+this._getCampaignHeaderHeight()),this.campaignHeaderAttached=!0),a-1?a.substring(0,a.indexOf("?")):a,b.isObject(this.desktopHeader)&&this.desktopHeader.setActiveSbu(a),b.isObject(this.mobileHeader)&&this.mobileHeader.setActiveSbu(a)}}.call(this),function(){var a=this;((a.NR||(a.NR={})).resolve("SDM.HeaderFooter.Widgets").Footer=function(a){var b={selectors:{footerGridSelector:".ftr-lnk-grid",footerItemSelector:"[data-ftr-nav-itm]",footerTitleSelector:"[data-ftr-nav-btn]",footerSubItemSelector:"a.ftr-sec-lnk"}};this.config=b,this.$widget=a,this._initialize()}).prototype._initialize=function(){}}.call(this),function(){var a=this,b=a._,c=a.jQuery,d=a.NR||(a.NR={}),e=d.resolve("SDM.HeaderFooter.Widgets"),f=e.Header,g="sdm-desktop-header",h={tab:9,enter:13,esc:27,space:32,left:37,up:38,right:39,down:40},i=f.DesktopHeader=function(a){var b={selectors:{bu_list:"[data-wg-hdr-nav-bu-list]",bu:"[data-wg-hdr-nav-bu]",bu_active:"[data-wg-hdr-nav-bu-active]",bu_menu:"[data-wg-hdr-nav-bu-menu]",bu_link:"[data-wg-hdr-nav-bu-link][aria-expanded]",sbu_list:"[data-wg-hdr-nav-sbu-list]",sbu:"[data-wg-hdr-nav-sbu]",sbu_menu:"[data-wg-hdr-nav-sbu-menu]",sbu_link:"[data-wg-hdr-ver-sbu-link][aria-expanded]",sbu_menu_links_container:"[data-wg-hdr-sbu-menu-links-contianer]",brands_menu:"[data-wg-hdr-nav-brands-menu]",brands_tab_list:"[data-wg-hdr-nav-brands-tab-list]",brands_tab:"[data-wg-hdr-nav-brands-tab]",brands_tab_container:"[data-wg-hdr-nav-brands-tab-container]",brands_tab_image:"[data-wg-hdr-nav-brands-tab-image]",horizontal_sbu_nav_item:"[data-wg-hdr-nav-hor-sbu]"},classes:{bu_with_border:"wg-hdr-nav-bu-with-border",bu_open:"wg-hdr-nav-bu-open",sbu_open:"wg-hdr-nav-ver-sbu-open",brands_tab_active:"wg-hdr-nav-brands-tab-active",sbu_image:"wg-hdr-nav-sbu-menu-with-image",sbu_no_image:"wg-hdr-nav-sbu-menu-no-image",horizontal_sbu_nav_item_active:"wg-hdr-nav-hor-sbu-active"},data_attributes:{bu_state:"wg-hdr-nav-bu-state",brands_tab:"wg-hdr-nav-brands-tab"},attributes:{aria_expanded:"aria-expanded"}};this.$widget=a,this.config=b,this._initialize()};i.prototype._initialize=function(){this._setInstanceVars(),this._fixNavHeights(),this._fixBrandsMenuHeight(),this._setBrandsMenu(),this._bindEvents(),this._bindBrandsTabEvents(),c(window).on("resizewhenextrawide",b.bind(this._fixHeaderHeight,this))},i.prototype._fixHeaderHeight=function(){this.$brandsMenus.find(this.config.selectors.brands_tab_container).css({height:"auto","max-height":"none"}),this._fixNavHeights(),this._fixBrandsMenuHeight()},i.prototype._setInstanceVars=function(){this.$buList=this.$widget.find(this.config.selectors.bu_list),this.$buLinks=this.$widget.find(this.config.selectors.bu_link),this.$BUs=this.$buList.find(this.config.selectors.bu),this.$BUMenus=this.$buList.find(this.config.selectors.bu_menu),this.$SBUs=this.$buList.find(this.config.selectors.sbu),this.$sbuLinks=this.$widget.find(this.config.selectors.sbu_link),this.$brandsMenus=this.$SBUs.find(this.config.selectors.brands_menu)},i.prototype._fixNavHeights=function(){b(this.$BUMenus).each(function(a){$bu_menu=c(a),c(a).css({height:"auto"});var d=$bu_menu.height();$sbu_menus=$bu_menu.find(this.config.selectors.sbu_menu),b($sbu_menus).each(function(a){c(a).css({height:"auto"});var b=c(a).height();d=b>d?b:d},this),$sbu_menus.css({height:d}),$bu_menu.css({height:d})},this)},i.prototype._fixBrandsMenuHeight=function(){b(this.$brandsMenus).each(function(a){$brand_menu=c(a);var b=$brand_menu.find(this.config.selectors.brands_tab_container),d=$brand_menu.find(this.config.selectors.brands_tab_list).outerHeight(!0),e=$brand_menu.height()-d;b.css({height:e,"max-height":e,"column-fill":"auto","-moz-column-fill":"auto"})},this)},i.prototype._setBrandsMenu=function(){b(this.$brandsMenus).each(function(a){$brand_menu=c(a);var b=$brand_menu.find("[data-wg-hdr-nav-brands-tab]").first(),d=b.data("wg-hdr-nav-brands-tab");$brand_menu.find(this.config.selectors.brands_tab).removeClass(this.config.classes.brands_tab_active),b.addClass(this.config.classes.brands_tab_active),$brand_menu.find(this.config.selectors.brands_tab_container).removeClass(this.config.classes.brands_tab_active),$brand_menu.find("[data-wg-hdr-nav-brands-tab-container="+d+"]").addClass(this.config.classes.brands_tab_active),this._toggleBrandsTabImage($brand_menu,d)},this)},i.prototype._bindEvents=function(){this.$buList.on("mouseover."+g,b.bind(function(a){var d=c(a.target).parents(this.config.selectors.bu);d.is(this.config.selectors.bu)&&"closed"===d.data(this.config.data_attributes.bu_state)&&this.$buList.doTimeout("bu",500,b(this._activateBU).bind(this,a))},this)),this.$buList.on("mouseleave."+g,b.bind(function(a){this.$buList.doTimeout("bu",500,b(this._deactivateBU).bind(this,a))},this)),this.$buLinks.on("keydown",b.bind(function(a){if(a.keyCode===h.space){a.preventDefault();var d=c(a.target).parent();"false"===c(a.currentTarget).attr(this.config.attributes.aria_expanded)?d.is(this.config.selectors.bu)&&"closed"===d.data(this.config.data_attributes.bu_state)&&this.$buList.doTimeout("bu",500,b(this._activateBU).bind(this,a)):this.$buList.doTimeout("bu",500,b(this._deactivateBU).bind(this,a))}},this))},i.prototype._bindBrandsTabEvents=function(){b(this.$brandsMenus).each(function(a){$brand_menu=c(a);var d=b(this._openBrandsTab).bind(this,$brand_menu);$brand_menu.find(this.config.selectors.brands_tab).off("click."+g).on("click."+g,d)},this)},i.prototype._openBrandsTab=function(a,b){a.find(this.config.selectors.brands_tab).removeClass(this.config.classes.brands_tab_active);var d=c(b.target);d.addClass(this.config.classes.brands_tab_active);var e=d.data(this.config.data_attributes.brands_tab);a.find(this.config.selectors.brands_tab_container).removeClass(this.config.classes.brands_tab_active),a.find("[data-wg-hdr-nav-brands-tab-container="+e+"]").addClass(this.config.classes.brands_tab_active),this._toggleBrandsTabImage(a,e)},i.prototype._toggleBrandsTabImage=function(a,b){var c=a.find("[data-wg-hdr-nav-brands-tab-image="+b+"]"),d=a.find(this.config.selectors.sbu_menu_links_container);a.find(this.config.selectors.brands_tab_image).hide(),c.length>0?(d.removeClass(this.config.classes.sbu_no_image).addClass(this.config.classes.sbu_image),c.show()):d.removeClass(this.config.classes.sbu_image).addClass(this.config.classes.sbu_no_image)},i.prototype._activateBU=function(a){this.$BUs.removeClass(this.config.classes.bu_with_border+" "+this.config.classes.bu_open),this.$SBUs.removeClass(this.config.classes.sbu_open),this.$BUs.data(this.config.data_attributes.bu_state,"closed"),this.$buLinks.attr(this.config.attributes.aria_expanded,"false"),$bu=c(a.target).parents(this.config.selectors.bu),this._configureBUMenu($bu),$bu.addClass(this.config.classes.bu_with_border+" "+this.config.classes.bu_open),$bu.data(this.config.data_attributes.bu_state,"open"),c(a.currentTarget).attr(this.config.attributes.aria_expanded,"true")},i.prototype._configureBUMenu=function(a){var c=a.find(this.config.selectors.sbu_list),d=c.find(this.config.selectors.sbu);this._activateFirstSBU(d),d.off("mouseenter."+g).on("mouseenter."+g,b(this._onSBUMouseEnter).bind(this,a,c,d)),d.on("focusin",b(this._onSBUFocusIn).bind(this,a,c,d)),d.on("keydown",b(this._onSBUFocusOut).bind(this,a,c,d))},i.prototype._deactivateBU=function(){this.$BUs.removeClass(this.config.classes.bu_with_border+" "+this.config.classes.bu_open),this.$BUs.data(this.config.data_attributes.bu_state,"closed"),this.$buLinks.attr(this.config.attributes.aria_expanded,"false"),this.$BUs.find(this.config.selectors.sbu+"."+this.config.classes.sbu_open).removeClass(this.config.classes.sbu_open),this.$buList.find(this.config.selectors.bu_active).addClass(this.config.classes.bu_with_border)},i.prototype._onSBUMouseEnter=function(a,b,d,e){d.removeClass(this.config.classes.sbu_open),$sbu=c(e.currentTarget),this._activateSBU($sbu)},i.prototype._onSBUFocusIn=function(a,b,d,e){d.removeClass(this.config.classes.sbu_open),$sbu=c(e.currentTarget),this._activateSBU($sbu)},i.prototype._onSBUFocusOut=function(a,b,d,e){$sbu=c(e.currentTarget),e.keyCode===Keys.tab&&e.shiftKey&&(d.removeClass(this.config.classes.sbu_open),this._deactivateSBU($sbu))},i.prototype._activateFirstSBU=function(a){var b=a.first();a.removeClass(this.config.classes.sbu_open),this._activateSBU(b)},i.prototype._activateSBU=function(a){a.addClass(this.config.classes.sbu_open),this.$sbuLinks.attr(this.config.attributes.aria_expanded,"false"),a.find(this.config.selectors.sbu_link).attr(this.config.attributes.aria_expanded,"true")},i.prototype._deactivateSBU=function(a){a.removeClass(this.config.classes.sbu_open),a.find(this.config.selectors.sbu_link).attr(this.config.attributes.aria_expanded,"false")},i.prototype.destroy=function(){this._deactivateBU(),this.$buList.off("mouseover."+g),this.$buList.off("mouseleave."+g),this.$BUMenus.removeAttr("style");var a=this.$widget.find(this.config.selectors.sbu);a.off("mouseenter."+g),a.find(this.config.selectors.sbu_menu).removeAttr("style"),this.$widget.find(this.config.selectors.brands_tab_container).removeAttr("style"),this.$widget.find(this.config.selectors.brands_tab_image).removeAttr("style")},i.prototype.setActiveSbu=function(a){var d=c(this.config.selectors.horizontal_sbu_nav_item),e=this.config.classes.horizontal_sbu_nav_item_active;if(b.isEmpty(a))return void d.removeClass(e);d.removeClass(e).filter(b.bind(function(b,d){return c(d).find("[href]").first().attr("href")===a},this)).first().addClass(e)}}.call(this),function(){var a=this,b=a._,c=a.jQuery,d=a.NR||(a.NR={}),e=d.resolve("SDM"),f=d.resolve("SDM.HeaderFooter.Widgets"),g=d.resolve("SDM.Core.Components"),h=g.EventHub,i=f.Header,j=e.Util,k="sdm-mobile-header",l=i.MobileHeader=function(a){var b={attributes:{sbu_active:"data-wg-hdr-nav-ver-active"},selectors:{nav:"[data-wg-hdr-nav]",bu_list:"[data-wg-hdr-nav-bu-list]",bu:"[data-wg-hdr-nav-bu]",bu_active:"[data-wg-hdr-nav-bu-active]",bu_menu:"[data-wg-hdr-nav-bu-menu]",sbu_list:"[data-wg-hdr-nav-sbu-list]",sbu:"[data-wg-hdr-nav-sbu]",sbu_link:"[data-wg-hdr-ver-sbu-link]",sbu_menu:"[data-wg-hdr-nav-sbu-menu]",bu_back:"[data-wg-hdr-nav-bu-menu-back]",sbu_back:"[data-wg-hdr-nav-sbu-menu-back]",hamburger:"[data-wg-hdr-mobile-hamburger]",hamburger_button:"[data-wg-hdr-mobile-hamburger-icon]",mobile_search:"[data-wg-hdr-mobile-search]",menu:"[data-wg-hdr-container]",mobile_search_tool:"[data-wg-hdr-mobile-search-tool]",sbu_active:"[data-wg-hdr-nav-ver-active]",bu_open_button:"[data-wg-hdr-nav-bu-open-button]",sbu_open_button:"[data-wg-hdr-nav-sbu-open-button]",campaign_header:"[data-wg-hdr-campaign-header]",skip_to_main:"[data-wg-hb-skip-to-main]",skip_to_footer:"[data-wg-hb-skip-to-footer]",sdm_header:"div.widget-header",sdm_footer:"section.footer",focusable_elements:"a[href]:not([disabled]), area[href]:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:visible, iframe, object, [contenteditable]"},classes:{bu_with_border:"wg-hdr-nav-bu-with-border",bu_open:"wg-hdr-nav-bu-open",bu_active:"wg-hdr-nav-bu-active",bu_list_active:"wg-hdr-nav-bu-list-active",bu_menu_active:"wg-hdr-nav-bu-menu-active",menu_open:"wg-hdr-open",search_open:"wg-hdr-search-open",sbu_active:"wg-hdr-nav-ver-mobile-sbu-active"},data_attributes:{bu_state:"wg-hdr-nav-bu-state"}};this.$widget=a,this.config=b,this._initialize()};l.prototype._initialize=function(){this._setInstanceVars(),this._resetMenu(),this._bindEvents(),this._setNavHeight(),this._resizeNavHeight(),this._cancelDebounce=!1},l.prototype._resizeNavHeight=function(){this._debouncedSetNavHeight=b.debounce(this._setNavHeight.bind(this),200),c(window).resize(this._debouncedSetNavHeight)},l.prototype._setNavHeight=function(){if(!this._cancelDebounce){var a=c("."+this.config.classes.bu_active+" ."+this.config.classes.sbu_active+" "+this.config.selectors.sbu_menu),b=c("."+this.config.classes.bu_active+" "+this.config.selectors.bu_menu),d=c(this.config.selectors.bu_list);a.length>0?this.$nav.css("min-height",a.height()):b.length>0?this.$nav.css("min-height",b.height()):this.$nav.css("min-height",d.height())}},l.prototype._setInstanceVars=function(){this.$hamburger=this.$widget.find(this.config.selectors.hamburger),this.$mobileSearch=this.$widget.find(this.config.selectors.mobile_search),this.$menu=this.$widget.find(this.config.selectors.menu),this.$mobileSearchTool=this.$widget.find(this.config.selectors.mobile_search_tool),this.$BUs=this.$menu.find(this.config.selectors.bu),this.$SBUs=this.$menu.find(this.config.selectors.sbu),this.$campaignHeader=this.$widget.find(this.config.selectors.campaign_header),this.$buBack=this.$menu.find(this.config.selectors.bu_back),this.$sbuBack=this.$menu.find(this.config.selectors.sbu_back),this.$nav=c(this.config.selectors.nav),this.$skipToMain=this.$widget.find(this.config.selectors.skip_to_main),this.$skipToFooter=this.$widget.find(this.config.selectors.skip_to_footer)},l.prototype._bindEvents=function(){this.$hamburger.off("click."+k).on("click."+k,b(this._toggleHamburger).bind(this)),this.$hamburger.off("keydown."+k).on("keydown."+k,b(this._focusMenu).bind(this)),this.$mobileSearch.off("click."+k).on("click."+k,b(this._toggleSearch).bind(this)),this.$buBack.off("click."+k).on("click."+k,b(this._closeBU).bind(this)),this.$sbuBack.off("click."+k).on("click."+k,b(this._closeSBU).bind(this)),b.each(this.$BUs,function(a){$bu=c(a),$bu.find(this.config.selectors.bu_open_button).off("click."+k).on("click."+k,b(this._toggleBU).bind(this,$bu))},this),b.each(this.$SBUs,function(a){$sbu=c(a),$sbu.find(this.config.selectors.sbu_open_button).off("click."+k).on("click."+k,b(this._toggleSBU).bind(this,$sbu))},this),this.$skipToMain.off("keydown."+k).on("keydown."+k,b(this._skipToMain).bind(this)),this.$skipToMain.off("click."+k).on("click."+k,b(this._skipToMain).bind(this)),this.$skipToFooter.off("keydown."+k).on("keydown."+k,b(this._skipToFooter).bind(this)),this.$skipToFooter.off("click."+k).on("click."+k,b(this._skipToFooter).bind(this)),h.subscribe(h.EVENTS.CLOSE_MOBILE_SBU,b(this._closeBU).bind(this))},l.prototype._skipToMain=function(a){if(13===a.keyCode||"click"===a.type){event.preventDefault();var b=c(this.config.selectors.sdm_header).closest("header").nextAll(":not(:hidden)").first();b.attr("id")||b.attr("id",Math.random().toString().substr(2,5)),document.location.href="#"+b.attr("id")}},l.prototype._skipToFooter=function(a){if(13===a.keyCode||"click"===a.type){a.preventDefault();c(this.config.selectors.sdm_footer).find(this.config.selectors.focusable_elements)[0].focus()}},l.prototype._focusMenu=function(a){if(9===a.keyCode&&this.$menu.hasClass(this.config.classes.menu_open)){var b=this;setTimeout(function(){b.$nav.find("a[href], button").first().focus()},1e3)}},l.prototype._toggleHamburger=function(){if(this.$mobileSearchTool.removeClass(this.config.classes.search_open),this.$menu.toggleClass(this.config.classes.menu_open),this.$menu.hasClass(this.config.classes.menu_open)){document.querySelector("body").style.overflow="hidden",this.$hamburger.find(this.config.selectors.hamburger_button).attr("aria-expanded","true");var a=this;setTimeout(function(){a.$nav.find("a[href], button").first().focus(),document.querySelector("#nav-overlay").setAttribute("tabindex","-1")},500)}else document.querySelector("body").style.overflow="auto",document.querySelector("#nav-overlay").removeAttribute("tabindex"),this.$hamburger.find(this.config.selectors.hamburger_button).attr("aria-expanded","false"),this.$BUs.find(this.config.selectors.bu_open_button).attr("aria-expanded","false"),this.$SBUs.find(this.config.selectors.sbu_open_button).attr("aria-expanded","false");c("."+this.config.classes.bu_list_active).removeClass(this.config.classes.bu_list_active),c("."+this.config.classes.bu_active).removeClass(this.config.classes.bu_active),c("."+this.config.classes.bu_menu_active).removeClass(this.config.classes.bu_menu_active),c("."+this.config.classes.sbu_active).removeClass(this.config.classes.sbu_active),this._setNavHeight(),h.fire(h.EVENTS.MOBILE_NAV_TOGGLE_CLICK)},l.prototype._toggleSearch=function(){this.$menu.removeClass(this.config.classes.menu_open),this.$mobileSearchTool.toggleClass(this.config.classes.search_open),"false"===this.$mobileSearch.attr("aria-expanded")?this.$mobileSearch.attr("aria-expanded","true"):this.$mobileSearch.attr("aria-expanded","false")},l.prototype._resetMenu=function(){this.$SBUs.removeClass(this.config.classes.sbu_active),this.$BUs.removeClass(this.config.classes.bu_active),this.$campaignHeader.length>0?h.fire(h.EVENTS.OPEN_MOBILE_CAMPAIGN_NAV):(this.$menu.find(this.config.selectors.bu+this.config.selectors.bu_active).addClass(this.config.classes.bu_active),this.$menu.find(this.config.selectors.sbu+this.config.selectors.sbu_active).addClass(this.config.classes.sbu_active))},l.prototype._scrollToActive=function(){var a=this.$menu.find(this.config.selectors.sbu_active),b=0,d=j.getMobileHeaderBarHeight();if(this.$campaignHeader.length>0)b=this.$campaignHeader.offset().top-d;else if(a.length>0)b=a.offset().top-d;else{var e=this.$menu.find(this.config.selectors.bu_active);e.length>0&&(b=e.offset().top-d)}c("html, body").animate({scrollTop:b},500)},l.prototype._scrollToTop=function(){c("html, body").animate({scrollTop:0},500)},l.prototype._toggleBU=function(a,b){b.preventDefault(),a.is("."+this.config.classes.bu_active)?(a.find(this.config.selectors.bu_open_button).attr("aria-expanded","false"),a.removeClass(this.config.classes.bu_active),this._setNavHeight(),c(this.config.selectors.bu_list).removeClass(this.config.classes.bu_list_active),h.fire(h.EVENTS.MOBILE_NAV_CLOSE_BUSINESS_UNIT)):(a.find(this.config.selectors.bu_open_button).attr("aria-expanded","true"),this.$BUs.filter("."+this.config.classes.bu_active).removeClass(this.config.classes.bu_active),this.$campaignHeader.length>0&&h.fire(h.EVENTS.CLOSE_MOBILE_CAMPAIGN_NAV),a.addClass(this.config.classes.bu_active),c(this.config.selectors.bu_list).addClass(this.config.classes.bu_list_active),this._setNavHeight())},l.prototype._closeBU=function(){this.$BUs.filter("."+this.config.classes.bu_active).find(this.config.selectors.bu_open_button).attr("aria-expanded","false"), this.$BUs.filter("."+this.config.classes.bu_active).removeClass(this.config.classes.bu_active),c(this.config.selectors.bu_list).removeClass(this.config.classes.bu_list_active),this._setNavHeight()},l.prototype._closeSBU=function(){this.$SBUs.filter("."+this.config.classes.sbu_active).find(this.config.selectors.sbu_open_button).attr("aria-expanded","false"),this.$SBUs.filter("."+this.config.classes.sbu_active).removeClass(this.config.classes.sbu_active),c("."+this.config.classes.bu_active+" "+this.config.selectors.bu_menu).removeClass(this.config.classes.bu_menu_active),this._setNavHeight()},l.prototype._toggleSBU=function(a,b){b.preventDefault(),a.is("."+this.config.classes.sbu_active)?(a.find(this.config.selectors.sbu_open_button).attr("aria-expanded","false"),a.removeClass(this.config.classes.sbu_active),this._setNavHeight(),c("."+this.config.classes.bu_active+" "+this.config.selectors.bu_menu).removeClass(this.config.classes.bu_menu_active),h.fire(h.EVENTS.MOBILE_NAV_CLOSE_SUB_BUSINESS_UNIT)):(a.find(this.config.selectors.sbu_open_button).attr("aria-expanded","true"),this.$SBUs.filter("."+this.config.classes.sbu_active).removeClass(this.config.classes.sbu_active),a.addClass(this.config.classes.sbu_active),c("."+this.config.classes.bu_active+" "+this.config.selectors.bu_menu).addClass(this.config.classes.bu_menu_active),this._setNavHeight())},l.prototype.destroy=function(){c(this.config.selectors.bu_list).removeClass(this.config.classes.bu_list_active),this.$nav.css("min-height","0px"),this._cancelDebounce=!0,this.$BUs.removeClass(this.config.classes.bu_active),this.$BUs.filter(this.config.selectors.bu_active).addClass(this.config.classes.bu_active),this.$SBUs.removeClass(this.config.classes.sbu_active),this.$menu.removeClass(this.config.classes.menu_open),document.querySelector("body").style.overflow="auto"},l.prototype.setActiveSbu=function(a){var d=this.config.attributes.sbu_active,e=this.config.selectors.sbu_open_button,f=this.config.selectors.sbu_link,g=this.config.classes.sbu_open;if(b.isEmpty(a))return void this.$SBUs.removeAttr(d).removeClass(g);this.$SBUs.removeAttr(d).filter(b.bind(function(b,d){return c(d).find(f).first().attr("href")===a})).attr(d,"").find(e).trigger("click")}}.call(this),function(){var a=this,b=a._,c=a.jQuery,d=a.NR||(a.NR={}),e=d.resolve("SDM.Core.Components"),f=e.Autocomplete,g=d.resolve("SDM.HeaderFooter.Widgets"),h=g.SearchAutocomplete=function(a){var b={attribute:{input_placeholder:"data-wg-hsac-placeholder"},selector:{form:"[data-wg-hb-tool-search-form]",input:"[data-wg-hsac-input]",template:"[data-wg-hsac-template]",fetch_error_template:"[data-wg-hsac-fetch-error-template]",loading_template:"[data-wg-hsac-loading-template]",container:"[data-wg-hsac-container]",result_list:"[data-wg-hsac-result-list]",result_item:"[data-wg-hsac-result-item]"},classes:{input_expand:"wg-hb-ts-input-expanded"},search_type:"all",result_limit:3,search_url:"/Search/GetStructuredSearch",min_search_length:4,result_types:{condition:"Condition",category:"Category",product:"Product",brand:"Brand",article:"Article"},view_all_link_template:"/search?query=<%= query %>&srhtype=<%= type %>",image_url_regex:/^.*:?(\/\/.*)/,image_domain_to_replace:"files.shoppersdrugmart.ca",image_domain_to_replace_with:"shoppersdrugmart.azureedge.net"};this.config=b,this.$widget=a,this._initialize()};h.prototype._initialize=function(){var d=b.template(this.$widget.find(this.config.selector.fetch_error_template).html())();new f(this.$widget,{input:this.config.selector.input,template:this.config.selector.template,show_loading:!0,submit_on_enter:!0,loading_template:this.config.selector.loading_template,container:this.config.selector.container,result_list:this.config.selector.result_list,result_item:this.config.selector.result_item,min_length:this.config.min_search_length,on_chose_callback:b(this._select).bind(this),on_select_callback:b(this._onSelect).bind(this),fetch_callback:b(this._fetchResults).bind(this),focus_callback:b(this._onFocus).bind(this),exit_callback:b(this._onExit).bind(this),fetch_error_html:d}),window.addEventListener("resize",this._reportWindowSize),this._reportWindowSize(),this.$widget.on("submit",b.bind(function(a){c(this.config.selector.input).val().length<=0&&a.preventDefault()},this)),this._bindWindowEvents(c(a))},h.prototype._fetchResults=function(a){var d=new c.Deferred,e=b(this._parseData).bind(this,d),f=this._getData(a);return c.when(f).done(e).fail(function(a,b){"abort"!==b&&d.reject()}),d},h.prototype._reportWindowSize=function(){window.innerWidth>960?document.querySelector(".wg-hdr-tool-search-container--desktop").contains(document.querySelector(".wg-hdr-tool-search"))||document.querySelector(".wg-hdr-tool-search-container--desktop").appendChild(document.querySelector(".wg-hdr-tool-search")):document.querySelector(".wg-hdr-tool-search-container--mobile").contains(document.querySelector(".wg-hdr-tool-search"))||document.querySelector(".wg-hdr-tool-search-container--mobile").appendChild(document.querySelector(".wg-hdr-tool-search"))},h.prototype._getData=function(a){return this.request&&this.request.abort(),this.request=c.ajax({type:"GET",url:this.config.search_url,headers:{"X-Requested-With":"XMLHttpRequest"},data:{query:a,numRes:this.config.result_limit,type:this.config.search_type}}),this.request},h.prototype._parseData=function(a,c){var d=c.FAQ||[],e=c.StructuredResult;e=b.reject(e,function(a){return a.Result.record_count<=0});var f=this.config.result_types,g=b.template(this.config.view_all_link_template);b.map(e,function(a){var d=a.Result.info.page.query;switch(a.Result=a.Result.records.page,a.Filter){case f.condition:a.ViewAllText=c.AllConditions,a.ViewAllUrl=g({query:d,type:"conditions"});break;case f.product:a.ViewAllText=c.AllProducts,a.ViewAllUrl=g({query:d,type:"products"});break;default:a.ViewAllText="",a.ViewAllUrl=""}b.each(a.Result,function(a){var c;a.image&&(c=a.image.match(this.config.image_url_regex),a.image=b.isNull(c)?"":c[1].replace(this.config.image_domain_to_replace,this.config.image_domain_to_replace_with))},this)},this),d.length&&e.push({Filter:"",FilterName:c.FAQLabel||"",Result:b.map(d,function(a){return{title:a.Title,url:a.Link}}),ViewAllText:"",ViewAllUrl:""}),c={templateData:{results:e,noResultsText:c.NoResults,imageRegex:this.config.image_url_regex}},a.resolve(c)},h.prototype._bindWindowEvents=function(){},h.prototype._onSelect=function(){},h.prototype._select=function(){},h.prototype._onFocus=function(){},h.prototype._onExit=function(){this.request&&this.request.abort()},h.prototype._addPlaceholder=function(){var a=this.$widget.find(this.config.selector.input).attr(this.config.attribute.input_placeholder)||"";this.$widget.find(this.config.selector.input).attr("placeholder",a)},h.prototype._removePlaceholder=function(){this.$widget.find(this.config.selector.input).removeAttr("placeholder")}}.call(this),function(){var a=this,b=a._,c=a.jQuery,d=a.NR||(a.NR={}),e=d.resolve("SDM.HeaderFooter.Widgets"),f=d.resolve("SDM.Core.Components"),g=f.EventHub,h="header-store-locator",i=e.StoreLocator=function(a,b){var d={selectors:{search_template:"[data-wg-hsl-template]",loading_template:"[data-wg-hsl-loading-template]",no_results_template:"[data-wg-hsl-no-results-template]",no_location_template:"[data-wg-hsl-no-location-template]",search_button:"[data-wg-hsl-search-button]",search_input:"[data-wg-hsl-search-input]",results_container:"[data-wg-hsl-results-container]",store:"[data-wg-hsl-store]"},classes:{no_border:"wg-hsl-store-no-border",active:"wg-hsl-store-active"},tool_name:"stores",domain:"/",search_url:"store/getstores",store_id_check_url:"store/isthisastoreid",store_detail_url:"/store-locator/store/",page:1,result_per_page:3,radius:500,unit:"km",lookup:"nearby",google_map_api_key:null};this.config=c.extend(!0,d,b||{}),this.$widget=a,this._initialize()};i.prototype._initialize=function(){this.language=SDM.Util.getShortLanguageCode(),this.isInitialized=!1,this.location={latitude:null,longitude:null},SDM.Util.isWindowWide()||this._setMobileSettings(),c(window).on("becometowide."+h,b(function(){this._switchModeToDesktop()}).bind(this)),c(window).on("becometonarrow."+h,b(function(){this._switchModeToMobile()}).bind(this)),g.subscribe(g.EVENTS.HEADER_TOOL_CLICKED,b.bind(function(a){a===this.config.tool_name&&this._startStoreLocator()},this))},i.prototype._setMobileSettings=function(){this.config.result_per_page=1},i.prototype._setPCSettings=function(){this.config.result_per_page=3},i.prototype._switchModeToMobile=function(){this._setMobileSettings(),this.isInitialized&&this._getUsersLocation()},i.prototype._switchModeToDesktop=function(){this._setPCSettings(),this.isInitialized&&this._getUsersLocation()},i.prototype._startStoreLocator=function(){if(!this.isInitialized){this.isInitialized=!0;var a=SDM.Util.loadGoogleMapsApi(this.config.google_map_api_key);!0===a?this._getUsersLocation():c.when(a).then(b(this._getUsersLocation).bind(this))}},i.prototype._getUsersLocation=function(){this.geocoder=new google.maps.Geocoder,this._bindSearchEvents();var a=this._askForUsersLocation(),d=b.bind(function(a){a&&(this._resetSearch(),this._showLoading(),this.location.latitude=a.coords.latitude,this.location.longitude=a.coords.longitude,this._showNearestStores())},this);c.when(a).then(d)},i.prototype._askForUsersLocation=function(){var a=c.Deferred();return navigator.geolocation?navigator.geolocation.getCurrentPosition(function(b){a.resolve(b)},function(b){console.log(b),a.resolve(null)}):a.resolve(null),a.promise()},i.prototype._showNearestStores=function(){this.searchString="";var a=this._getStores(this.location.latitude,this.location.longitude),d=b(this._renderStores).bind(this);c.when(a).then(d)},i.prototype._showNoLocationFound=function(){var a=b.template(c(this.config.selectors.no_location_template).html());c(this.config.selectors.results_container).html(a())},i.prototype._showLoading=function(){var a=b.template(c(this.config.selectors.loading_template).html());c(this.config.selectors.results_container).html(a())},i.prototype._showNoResults=function(){var a=b.template(c(this.config.selectors.no_results_template).html());c(this.config.selectors.results_container).html(a())},i.prototype._resetSearch=function(){c(this.config.selectors.search_input).val("")},i.prototype._renderStores=function(a){if(a&&a.count>0){var d=b.template(c(this.config.selectors.search_template).html()),e=d({stores:a.results,search_string:this.searchString});c(this.config.selectors.results_container).html(e),this._bindHoverEvents()}else this._showNoResults()},i.prototype._bindHoverEvents=function(){var a=b.bind(function(a){$target=c(a.currentTarget),$sibling=$target.next(),$sibling.toggleClass(this.config.classes.no_border),$target.toggleClass(this.config.classes.active)},this);c(this.config.selectors.store).on("mouseenter",a),c(this.config.selectors.store).on("mouseleave",a)},i.prototype._bindSearchEvents=function(){var a=b(this._search).bind(this);c(this.config.selectors.search_button).on("click."+h,a),enter_callback=b.bind(function(a){13===a.which&&this._search(a)},this),c(this.config.selectors.search_input).on("keypress."+h,enter_callback)},i.prototype._search=function(a){a.preventDefault();var d=b.bind(function(a){if(a.length>0){var d=a[0].geometry.location,e=d.lat(),f=d.lng(),g=this._getStores(e,f),h=b(this._renderStores).bind(this);c.when(g).then(h)}else this._showNoResults()},this);if(this.searchString=c(this.config.selectors.search_input).val(),""===this.searchString)this._showNoLocationFound();else if(c.isNumeric(this.searchString)&&Math.floor(this.searchString)===parseInt(this.searchString,10)){this._showLoading();var e=this._isThisAStoreId(this.searchString);c.when(e).then(b.bind(function(a){if(a){var b=this.config.domain+this.language+this.config.store_detail_url+this.searchString;window.location=b}else this.geocoder.geocode({address:this.searchString},d)},this))}else this._showLoading(),this.geocoder.geocode({address:this.searchString},d)},i.prototype._isThisAStoreId=function(a){var b=this.config.domain+this.language+"/"+this.config.store_id_check_url;return c.ajax({dataType:"json",url:b,headers:{"X-Requested-With":"XMLHttpRequest"},data:{id:a}})},i.prototype._getStores=function(a,b){var d=this.config,e=this.config.domain+this.language+"/"+this.config.search_url;return c.ajax({url:e,data:{latitude:a,longitude:b,radius:d.radius,unit:d.unit,lookup:d.lookup,page:d.page,rpp:d.result_per_page},headers:{"X-Requested-With":"XMLHttpRequest"},dataType:"json"})}}.call(this),function(){var a=this,b=a._SDM||a._,c=a.$SDM||a.jQuery,d=a.NR||(a.NR={}),e=d.resolve("SDM"),f=e.Util||(e={}),g={tab:9,enter:13,esc:27,space:32,left:37,up:38,right:39,down:40},h=e.Footer=function(a){var b={namespace:"sdm-header",active_class:"active",privacy_cookie_name:"privacy-cookie",nav_itm:"data-ftr-nav-itm",nav_btn:"data-ftr-nav-btn",sub_nuv:"data-ftr-sub-nav",nav_mob_link:"data-ftr-title-mob-link",selectors:{back_to_top_button:"[data-wg-back-to-top]",privacy_cookie:"[data-privacy-cookie]",privacy_cookie_close_button:"[data-privacy-cookie-close-button]"}};this.isMobileNavEnabled=!1,this.config=c.extend(!0,b,a||{}),this._initialize()};h.prototype._initialize=function(){var a=this;window.innerWidth<=480?a._startMobileNav():a._terminateMobileNav(),window.addEventListener("resize",function(b){b.target.innerWidth<=480?a._startMobileNav():a._terminateMobileNav()}),this._initializeBackToTopButton(),this._initializeCookiePrivacy()},h.prototype._startMobileNav=function(){this.isMobileNavEnabled||(c(".footer__sitemap-list-container").css("max-height","0"),c(".footer__sitemap-title").removeClass("footer__sitemap-title-arrow--open"),c(".footer__sitemap-title").addClass("footer__sitemap-title-arrow--closed"),c(".footer__sitemap-title").attr("aria-expanded","false"),c(".footer__sitemap-title").attr("tabindex","0"),c(".footer__sitemap-link").attr("tabindex","-1"),c(".footer__sitemap-link").attr("aria-hidden","true"),c(".footer__sitemap-title").click(function(){c(this).next(".footer__sitemap-list-container").css("max-height","0"),c(this).removeClass("footer__sitemap-title-arrow--open"),c(this).addClass("footer__sitemap-title-arrow--closed"),c(this).attr("aria-expanded","false"),c(this).next(".footer__sitemap-list-container").find(".footer__sitemap-link").attr("tabindex","-1"),c(this).next(".footer__sitemap-list-container").find(".footer__sitemap-link").attr("aria-hidden","true");var a=c(this).next(".footer__sitemap-list-container").height(),b=c(this).next(".footer__sitemap-list-container").find(".footer__sitemap-list").height();Math.round(a)!==Math.round(b)&&(c(this).next(".footer__sitemap-list-container").css({"max-height":b}),c(this).addClass("footer__sitemap-title-arrow--open"),c(this).removeClass("footer__sitemap-title-arrow--closed"),c(this).attr("aria-expanded","true"),c(this).next(".footer__sitemap-list-container").find(".footer__sitemap-link").attr("tabindex","0"),c(this).next(".footer__sitemap-list-container").find(".footer__sitemap-link").attr("aria-hidden","false"))}),c(".footer__sitemap-title").on("keydown",b(this._toggleMobileSitemapList).bind(this)),this.isMobileNavEnabled=!0)},h.prototype._toggleMobileSitemapList=function(a){var b=c(a.currentTarget);if(a.keyCode===g.enter){b.next(".footer__sitemap-list-container").css("max-height","0"),b.removeClass("footer__sitemap-title-arrow--open"),b.addClass("footer__sitemap-title-arrow--closed"),b.attr("aria-expanded","false"),b.next(".footer__sitemap-list-container").find(".footer__sitemap-link").attr("tabindex","-1"),b.next(".footer__sitemap-list-container").find(".footer__sitemap-link").attr("aria-hidden","true");var d=b.next(".footer__sitemap-list-container").height(),e=b.next(".footer__sitemap-list-container").find(".footer__sitemap-list").height();Math.round(d)!==Math.round(e)&&(b.next(".footer__sitemap-list-container").css({"max-height":e}),b.addClass("footer__sitemap-title-arrow--open"),b.removeClass("footer__sitemap-title-arrow--closed"),b.attr("aria-expanded","true"),b.next(".footer__sitemap-list-container").find(".footer__sitemap-link").attr("tabindex","0"),b.next(".footer__sitemap-list-container").find(".footer__sitemap-link").attr("aria-hidden","false"))}},h.prototype._terminateMobileNav=function(){this.isMobileNavEnabled&&(c(".footer__sitemap-list-container").css("max-height","500px"),c(".footer__sitemap-title").unbind("click"),c(".footer__sitemap-title").unbind("keydown"),c(".footer__sitemap-title").removeAttr("tabindex"),c(".footer__sitemap-title").removeAttr("aria-expanded"),c(".footer__sitemap-link").removeAttr("tabindex"),c(".footer__sitemap-link").removeAttr("aria-hidden"),this.isMobileNavEnabled=!1)},h.prototype._initializeBackToTopButton=function(){c(this.config.selectors.back_to_top_button).on("click."+this.config.namespace,b(function(){f.scrollTo$ElementAsync(c("[data-header-container]"),400)}).bind(this)),this.toggleBackToTopButton(c(this.config.selectors.back_to_top_button),!1);c(window).on("scroll",b.throttle(b(function(){var a=this.lastScrollTop>c(window).scrollTop();this.lastScrollTop=c(window).scrollTop(),this.toggleBackToTopButton(c(this.config.selectors.back_to_top_button),a)}).bind(this),200))},h.prototype.toggleBackToTopButton=function(a,b){f.getScrollPos()<=0||!b?a.removeClass("wg-btt__button-container--visible"):a.addClass("wg-btt__button-container--visible")},h.prototype._initializeCookiePrivacy=function(){f.getValueFromCookie("privacy-cookie")||c(this.config.selectors.privacy_cookie).addClass("footer__privacy-cookie--visible"),c(this.config.selectors.privacy_cookie_close_button).on("click."+this.config.namespace,b(function(){var a=new Date;a.setDate(a.getDate()+90),f.saveCookie("privacy-cookie",!0,null,a.toUTCString()),c(this.config.selectors.privacy_cookie).removeClass("footer__privacy-cookie--visible")}).bind(this))}}.call(this),function(){var a=this,b=a.jQuery,c=a.NR||(a.NR={}),d=c.resolve("SDM.HeaderFooter"),e=c.resolve("SDM.HeaderFooter.Widgets");(d.Initializer=function(a){var c={widgets:{header_bar:"header-bar",header_mobile_banner:"header-mobile-banner",header:"header",footer:"footer",header_scroller:"header-scroller",store_locator:"header-store-locator",search_autocomplete:"header-search-autocomplete",brooklyn_login:"header-brooklyn-login"}};this.config=b.extend(!0,c,a||{}),this._initialize()}).prototype._initialize=function(){var a=b("[data-widget]"),c=this.config.widgets;_.each(a,function(a){var d=b(a),f=d.data("widget").split(/\s+/);_.each(f,function(a){switch(a){case c.header_bar:new e.HeaderBar(d);break;case c.header_mobile_banner:new e.HeaderMobileBanner(d);break;case c.header:new e.Header(d);break;case c.header_scroller:new e.HeaderScroller;break;case c.store_locator:new e.StoreLocator(d);break;case c.footer:new e.Footer(d);break;case c.search_autocomplete:new e.SearchAutocomplete(d);break;case c.brooklyn_login:new e.BrooklynLogin(d)}},this)},this)}}.call(this);